Skip to content

Improve ssl read internal#3324

Merged
josesimoes merged 1 commit intomainfrom
improve-ssl-read-internal
Apr 16, 2026
Merged

Improve ssl read internal#3324
josesimoes merged 1 commit intomainfrom
improve-ssl-read-internal

Conversation

@Ellerbach
Copy link
Copy Markdown
Member

@Ellerbach Ellerbach commented Apr 15, 2026

Description

  • Enhanced SSL socket error handling to more accurately distinguish between temporary blocking states, peer disconnections, and actual connection errors, improving reliability of secure socket operations.

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

The change refines error handling in the SSL read function to explicitly distinguish between different mbedTLS error codes, mapping them to appropriate result codes instead of treating them generically.

Changes

Cohort / File(s) Summary
SSL Read Error Handling
src/PAL/COM/sockets/ssl/MbedTLS/ssl_read_internal.cpp
Refines error handling for mbedtls_ssl_read return values: MBEDTLS_ERR_SSL_WANT_READ and MBEDTLS_ERR_SSL_WANT_WRITE now return SSL_RESULT__WOULD_BLOCK, peer close notification and zero returns map to end-of-stream, and other negatives consistently map to SOCK_SOCKET_ERROR.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change to the ssl_read_internal function, describing the improvement to SSL read behavior.
Description check ✅ Passed The PR description clearly relates to the changeset, describing SSL socket error handling improvements with specific technical details matching the code changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Ellerbach Ellerbach requested a review from josesimoes April 15, 2026 13:21
Copy link
Copy Markdown
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks,

@josesimoes josesimoes added the Area: Common libs Everything related with common libraries label Apr 16, 2026
@josesimoes josesimoes merged commit e518213 into main Apr 16, 2026
27 checks passed
@josesimoes josesimoes deleted the improve-ssl-read-internal branch April 16, 2026 15:31
josesimoes pushed a commit that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Common libs Everything related with common libraries Type: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants